package cn.zlp.hrm.client;

import cn.zlp.hrm.domain.LoginUser;
import cn.zlp.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @program: hrm-parent
 * @author: Mr.Zhang
 * @create: 2022-01-02 21:07
 **/
@Component // 注意要交给spring管理
public class LoginUserClientFallbackFactory implements FallbackFactory<LoginUserClient> {
    @Override
    public LoginUserClient create(Throwable throwable) {
        return new LoginUserClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("系统维护中.....");
            }
        };
    }
}
